package com.example.test.suppert.base.result;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by lsl on 2021/3/2.
 */
@SuppressWarnings("rawtypes")
public class ErrorResult extends BaseResult implements Serializable {
    private static final long serialVersionUID = -2336441373804233326L;
    private String application;
    private String url;
    private String date;
    private Boolean businessError;

    public void setApplication(String application) {
        this.application = application;
    }

    public String getApplication() {
        return application;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDate() {
        return date;
    }

    public Boolean getBusinessError() {
        return businessError;
    }

    public ErrorResult(Object data, String subCode, String subMsg) {
        this();
        this.data = data;
        this.subCode = subCode;
        this.subMsg = subMsg;
    }

    public ErrorResult(String subCode, String subMsg) {
        this();
        this.subCode = subCode;
        this.subMsg = subMsg;
    }

    public ErrorResult(String subMsg) {
        this();
        this.subMsg = subMsg;
    }

    public ErrorResult(Object data) {
        this();
        this.data = data;
    }

    public ErrorResult() {
        this.application = "unknown";
        this.url = "unknown";
        this.date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date());
        this.businessError = true;
        this.success = false;
        this.code = BUSINESS_ERROR_CODE;
        this.msg = "失败";
    }

}
